package com.fog.judge.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fog.judge.entity.SelectCourse;
import com.fog.judge.mapper.SelectCourseMapper;
import com.fog.judge.service.SelectCourseService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SelectCourseServiceImpl extends ServiceImpl<SelectCourseMapper, SelectCourse> implements SelectCourseService {

    @Override
    public List<SelectCourse> getSelectsByStudentId(Integer userId) {
        LambdaQueryWrapper<SelectCourse> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SelectCourse::getStudentId, userId);
        return this.baseMapper.selectList(queryWrapper);
    }
}
